package spider.util;

import spider.NovelSiteEnum;
import spider.impl.chapter.DefaultChapterDetailSpider;
import spider.interfaces.IChapterDetailSpider;

/**
 * created by yb
 * on 2017/8/11.
 **/
public final class ChapterDetailSpiderFactory {
    private ChapterDetailSpiderFactory() {
    }

    /**
     * 通过给定的url  返回实现类
     * @param url 指定的章节列表的url
     * @return IChapterDetailSpider 的实现类
     */
    public static IChapterDetailSpider GetChapterDetailSpider(String url) {
        IChapterDetailSpider chapterDetailSpider = null;
        NovelSiteEnum novelSiteEnum = NovelSiteEnum.getNovelSiteEnumByUrl(url);
        switch (novelSiteEnum){
            case DingDianXiaoShuo:
            case BiQuGe:
            case BiXiaWenXue:
            case KanShuZhong:
                chapterDetailSpider = new DefaultChapterDetailSpider();
        }
        return chapterDetailSpider;
    }
}
